package com.hh.hot100;


/**
 * @Author hanghao
 * @Date 2023/7/3 14:04
 * @Version 1.0
 * 翻转二叉树
 * easy
 */

public class No226 {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) return root;
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        invertTree(root.left);
        invertTree(root.right);
        return root;
    }
}
